
const getStartPageTplHtml = () => {
    const tpl = `
    
    <html lang="en"><script></script><head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin:0px;
            padding:0px;
        }
        .startPage {
            display: flex;
            align-items: center;
            justify-content: center;
            height:100vh;
        }
        .startPage-logo {
            width:152px;
        }
    </style>
</head>
<body>
    <div class="startPage">
        <img class="startPage-logo" src="imgs/icon-152x152.png">
    </div>
    <script>
        setTimeout(()=> {
            window.location.href= "/index.html";
        }, 3000)
    </script>

    <div id="janus-extension-installed" style="display: none;"></div></body></html>
    
    `;

    return tpl;
}

const  getTplIndexHtml = () => {
    const tpl = `

    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
        
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="default">
        <meta name="apple-mobile-web-app-title" content="demo">

        <meta name="application-name" content="demo" />
        <meta name="msapplication-TileColor" content="#222">
        <meta name="msapplication-square70x70logo" content="img/icon-72x72.png" />
        <meta name="msapplication-square150x150logo" content="img/icon-144x144.png" />
        <meta name="msapplication-square310x310logo" content="img/icon-256x256.png" />

        <title>demo</title>

        <link rel="manifest" href="/manifest.json">
        <!-- Standard iPhone -->
        <link rel="apple-touch-icon" sizes="57x57" href="imgs/icon-114x114.png">
        <!-- Retina iPhone -->
        <link rel="apple-touch-icon" sizes="114x114" href=“imgs/touch-icon-iphone-114.png">
        <link rel="apple-touch-icon" href="img/icon-256x256.png">
        <!-- Standard iPad -->
        <link rel="apple-touch-icon" sizes="72x72" href=“imgs/touch-icon-ipad-144.png">
        <!-- Retina iPad -->
        <link rel="apple-touch-icon" sizes="144x144" href=“imgs/touch-icon-ipad-144.png">

        <!-- 滚动加载  -->
        <style>
        * {
            margin:0;
            padding:0;
        }
        </style>
       
    </head>
    <body>
        首页
    </body>
</html>

    `;

    return tpl;
}


const getManifestTpl = (answer) => {

  
    const tpl = `{
        "name": "${answer.appName}",
        "short_name": "${answer.short_name}",
        "theme_color": "${answer.theme_color}",
        "background_color": "${answer.background_color}",
        "display": "${answer.display}",
        "Scope": "${answer.scope}",
        "start_url": "${answer.start_url}",
        "icons": [
            {
                "src": "imgs/icon-72x72.png",
                "sizes": "72x72",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-96x96.png",
                "sizes": "96x96",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-114x114.png",
                "sizes": "114x114",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-128x128.png",
                "sizes": "128x128",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-144x144.png",
                "sizes": "144x144",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-152x152.png",
                "sizes": "152x152",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-192x192.png",
                "sizes": "192x192",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-384x384.png",
                "sizes": "384x384",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-256x256.png",
                "sizes": "256x256",
                "type": "image/png"
            },
            {
                "src": "imgs/icon-512x512.png",
                "sizes": "512x512",
                "type": "image/png"
            }
        ],
        "splash_pages": null
    }`
    
    return tpl;
}

module.exports = {
    getManifestTpl,
    getTplIndexHtml,
    getStartPageTplHtml
}
